package com.android.djlmapp.tools.global;

import android.content.Context;

public class Constants {

    // appid
    public static final String APP_ID = "wxa705f1b0d9e614da";
    // 商户号
    public static final String MCH_ID = "1364256902";
    // key
    public static final String API_KEY = "d4624c36b6795d1d99dcf0547af5443d";


    // 由推送跳转而来
    public static boolean JPUSH_INTENT = false;
    // 应用未推出
    public static boolean APPLICATION_OPEN = false;

    public static String zhiWenNum = getZhiWenNum();

    public static String getZhiWenNewPwd(Context context) {
        String token = PrefUtils.getString(ConstantsValue.TOKEN, "");
        return zhiWenNum + MD5Util.MD5("DJLM_TOUCH_PAY" + zhiWenNum +
                token + getZhiWenTouchPwd(context)).toLowerCase();
    }

    public static String getZhiWenTouchPwd(Context context) {
        return PrefUtils.getString(ConstantsValue.ZHIWEN_KEY, "");
    }

    public static String getZhiWenNum() {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            sb.append("" + (int) (10 * (Math.random())));
        }
        return sb.toString();
    }
}
